<?php
include_once '../vendor/autoload.php';

//提示信息
function print_help() {
    echo "Usage: php text.php [-h | --help] -b <bucketName> -f <fileKey> -l <localFile>\n\r";
}


$opts = "h:b:f:l:";
$longopts = ['help'];
$options = getopt($opts,$longopts);


if(isset($options['h']) || isset($options['help']) || empty($options)){
    print_help();
    exit(0);
}


if(!isset($options['l'])){
    echo 'please input localFile';
    exit(0);
}
if(!file_exists($filePath)){
    echo 'wrong localFile path!';
    exit(0);
}

$filename = basename($options['l']);
$fileKey = isset($options['f'])? $options['f'] : "$filename";
$bucketName = isset($options['b'])? $options['b'] : 'hotcast-test001';

//$url = \Wcs\WcsFile::UploadMkblk('hotcast-test001','bigvideo.mp4','flm.mp4');
//print_r($url);